﻿using System;
using System.Collections.Generic;
using System.Text;
using SwinGame;
using System.Drawing;

namespace SurvivalNN.src
{

    class SimplePropView : IPropView
    {

        public SimplePropView(IEntitySubModel model) //loosely couples takes interface
        {
            SetTargetModel(model);
        }

        public void SetTargetModel(IEntitySubModel model)
        {
            model.PositionChangeHandler += PositionChangeEventResponse;
        }

        public void Draw()
        {
            SwinGame.Graphics.DrawCircle(_color, _position.X, _position.Y, _size);
        }

        /////////////
        //Accessors//
        /////////////

        /////////////
        //Color    //
        /////////////
        Color _color = Color.Aqua;
        public Color Color
        {
            get { return _color; }
            set { _color = value; }
        }

        /////////////
        //Postition//
        /////////////
        Point2D _position = new Point2D();
        public Point2D Position
        {
            get { return _position; }
            set { _position = value; }
        }
  
        ////////
        //Size//
        // /////
        int _size = 10;
        public int Size
        {
            get { return _size; }
            set { _size = value; }
        }

        ///////////////////
        //Event Reactions//
        ///////////////////
        public void PositionChangeEventResponse(object sender, PositionChangeEvent posEvent)
        {
            _position.X = posEvent._newPosition.X;
            _position.Y = posEvent._newPosition.Y;
        }
    }
}
